package cn.dogger.easyboot.init.runner;

import cn.dogger.easyboot.init.service.InitTableService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * 初始化
 * @author dogger
 * 2022/7/19 21:54
 */
@Component
@Lazy
public class InitTableRunner implements CommandLineRunner {

    private final InitTableService service;

    public InitTableRunner(InitTableService service) {
        this.service = service;
    }

    @Override
    public void run(String... args) {
        System.out.println(">>>>>>>>>>>>>>>初始化数据库<<<<<<<<<<<<<");
        service.initTable();
    }
}
